From e0bebba4701395b8db6027bd8626e879a4cde90d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 23 Jun 2016 16:31:24 -0400 Subject: [PATCH] headerbar: simplify calculation in size allocation code There's some extraneous MIN() calls that have predetermined answers. This commit drops them and then simplifies a few redudant checks into one MIN call. https://bugzilla.gnome.org/show_bug.cgi?id=724332 --- gtk/gtkheaderbar.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index fb427d163a..c16cf8a6ab 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -1133,14 +1133,7 @@ gtk_header_bar_allocate_contents (GtkCssGadget *gadget, child_allocation.y = allocation->y; child_allocation.height = allocation->height; - width = MAX (side[0], side[1]); - - if (allocation->width - 2 * width >= title_natural_size) - child_size = MIN (title_natural_size, allocation->width - 2 * width); - else if (allocation->width - side[0] - side[1] >= title_natural_size) - child_size = MIN (title_natural_size, allocation->width - side[0] - side[1]); - else - child_size = allocation->width - side[0] - side[1]; + child_size = MIN (allocation->width - side[0] - side[1], title_natural_size); child_allocation.x = allocation->x + (allocation->width - child_size) / 2; child_allocation.width = child_size; -- 2.30.2